
package com.jf.cloud.api.user.feign;

import com.jf.cloud.api.payment.vo.ShopAccountDetailVO;
import com.jf.cloud.api.user.bo.BalancePayBO;
import com.jf.cloud.api.user.bo.BalanceRefundBO;
import com.jf.cloud.api.user.dto.FinanceDetailDTO;
import com.jf.cloud.api.user.vo.FinanceDetailExcelVO;
import com.jf.cloud.api.user.vo.FinanceDetailVO;
import com.jf.cloud.api.user.vo.UserPayInfoVO;
import com.jf.cloud.common.database.vo.PageVO;
import com.jf.cloud.common.feign.FeignInsideAuthConfig;
import com.jf.cloud.common.response.ServerResponseEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Date;
import java.util.List;

/**
 * 充值信息
 * @author zz
 */
@FeignClient(value = "jfcloud-user",contextId = "user-recharge")
public interface UserBalanceLogClient {

    /**
     * 获取充值金额
     * @param balanceLogId 充值记录id
     * @return
     */
    @GetMapping(value = FeignInsideAuthConfig.FEIGN_URL_PREFIX + "/insider/userBalanceLog/getPayAmount")
    ServerResponseEntity<Long> getPayAmount(@RequestParam("balanceLogId") Long balanceLogId);

    /**
     * 获取充值记录是否已经支付
     * @param balanceLogId 充值记录id
     * @return
     */
    @GetMapping(value = FeignInsideAuthConfig.FEIGN_URL_PREFIX + "/insider/userBalanceLog/getIsPay")
    ServerResponseEntity<Integer> getIsPay(@RequestParam("balanceLogId") Long balanceLogId);


    /**
     * 余额支付记录
     * @param balancePayBO 记录信息
     * @return
     */
    @PostMapping(value = FeignInsideAuthConfig.FEIGN_URL_PREFIX + "/userBalanceLog/insertBalancePayLog")
    ServerResponseEntity<Void> insertBalancePayLog(@RequestBody BalancePayBO balancePayBO);

    /**
     * 余额退款记录 + 执行退款
     * @param balanceRefundBO 记录信息
     * @return
     */
    @PostMapping(value = FeignInsideAuthConfig.FEIGN_URL_PREFIX + "/insider/userBalanceLog/insertBalanceRefundLog")
    ServerResponseEntity<Void> doRefund(@RequestBody BalanceRefundBO balanceRefundBO);

    /**
     * 分页获取余额充值财务对账信息
     * @param financeDetailDTO
     * @return
     */
    @GetMapping(value = FeignInsideAuthConfig.FEIGN_URL_PREFIX + "/insider/userBalanceLog/pageFinanceDetail")
    ServerResponseEntity<PageVO<FinanceDetailVO>> pageFinanceDetail(@RequestBody FinanceDetailDTO financeDetailDTO);

    /**
     * 获取余额充值财务对账信息
     * @param financeDetailDTO
     * @return
     */
    @GetMapping(value = FeignInsideAuthConfig.FEIGN_URL_PREFIX + "/insider/userBalanceLog/listFinanceDetail")
    ServerResponseEntity<List<FinanceDetailExcelVO>> listFinanceDetail(@RequestBody FinanceDetailDTO financeDetailDTO);

    /**
     * 获取平台财务信息
     * @param startTime
     * @param endTime
     * @return
     */
    @GetMapping(value = FeignInsideAuthConfig.FEIGN_URL_PREFIX + "/insider/userBalanceLog/getPlatformAccountDetail")
    ServerResponseEntity<ShopAccountDetailVO> getPlatformAccountDetail(@RequestParam(value = "startTime", required = false) Date startTime,
                                                                       @RequestParam(value = "endTime",required = false) Date endTime);

    /**
     * 获取用户充值，购买会员财务信息
     * @param startTime
     * @param endTime
     * @param financeType
     * @param pageSize
     * @param pageNum
     * @return
     */
    @GetMapping(value = FeignInsideAuthConfig.FEIGN_URL_PREFIX + "/insider/userBalanceLog/pageUserPayInfo")
    ServerResponseEntity<PageVO<UserPayInfoVO>> pageUserPayInfo(@RequestParam(value = "startTime", required = false) Date startTime,
                                                                @RequestParam(value = "endTime",required = false) Date endTime,
                                                                @RequestParam(value = "financeType") Integer financeType,
                                                                @RequestParam("pageSize") Integer pageSize,
                                                                @RequestParam("pageNum") Integer pageNum);

    /**
     * 获取用户充值，购买会员财务信息
     * @param startTime
     * @param endTime
     * @param financeType
     * @return
     */
    @GetMapping(value = FeignInsideAuthConfig.FEIGN_URL_PREFIX + "/insider/userBalanceLog/listUserPayInfo")
    ServerResponseEntity<List<UserPayInfoVO>> listUserPayInfo(@RequestParam(value = "startTime", required = false) Date startTime,
                                                                @RequestParam(value = "endTime",required = false) Date endTime,
                                                                @RequestParam(value = "financeType") Integer financeType);
}
